'use strict';

angular.module('ProduceReady').controller('MOListController', ['$scope', 'PublicService', 'PublicModule', 'PublicEnum', 'PublicFunction', 'BarcodeEnum', '$location', 'Authentication',
    function($scope, PublicService, PublicModule, PublicEnum, PublicFunction, BarcodeEnum, $location, Authentication) {
        PublicService.getExtendEnum('ItemCategory', function(extendEnum){
            $scope.ItemCategoryEnum = extendEnum;
        });

    	PublicModule.initModule($scope, 'MO');
        $scope.Module.MO.LoadMode = PublicEnum.LoadMode.CacheAndPaging;
        $scope.Module.MO.QueryParameter.Populate = [{path: 'ItemMaster', select: 'Code Name'}];
        $scope.Module.MO.PageSize = 15;
        $scope.Module.MO.load();

        // $scope.btnAdd = function(){
        // 	$location.url('/index/MO/Edit');
        // };

        $scope.rowDblClick = function(){
            // $scope.$apply(function(){
            //     $location.url("/index/MO/Edit/" + $scope.Module.MO.FocusedRecord._id);
            // });
        };

        // $scope.btnDelete = function(){
        // 	$scope.Module.MO.deleteSelecteds(function(){
        // 		$scope.Module.MO.load();
        // 	});
        // };
    }
]);